package biz;

import dao.AdminDao;

import java.util.Map;

public class AdminBiz {
    private AdminDao dao = new AdminDao();
    public  Map<String,Object> adminLogin(String name, String pwd) throws BizException {
        if (name==null || name.trim().equals("")){
            throw  new BizException("用户名不能为空");
        }

        if (pwd==null || pwd.trim().equals("")){
            throw  new BizException("密码不能为空");
        }

        Map<String,Object> admin = dao.adminLogin(name,pwd);
        if (admin ==null){
            throw new BizException("用户名或密码错误!请确认后重新输入...");
        }
        return admin;
    }
}
